package com.olmarket.core.service;

import com.olmarket.core.dao.UserDAO;
import com.olmarket.core.dao.UserStudentDAO;
import com.olmarket.core.entity.GoodInfo;
import com.olmarket.core.entity.RequestInfo;
import com.olmarket.core.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author h'zh
 * @date: 12.14
 */

@Service
public class StudentService {
    @Autowired
    private UserDAO userDAO;
    @Autowired
    private UserStudentDAO userStudentDAO;

    public User getUser(String username, int userType) {
        return userDAO.getUserByNameAndUserType(username, userType);
    }

    //查询学生信息
//    public List<UserStudentResult> getGroupList(int pageNum, int pageSize, String term, String keyword) {
//        if (null != keyword) {
//            keyword = "%" + keyword + "%";
//        }
//        if (pageSize == -1) {
//            pageSize = Integer.MAX_VALUE;
//        }
//        PageHelper.startPage(pageNum, pageSize);
//        return term == null ? null : userDAO.getGroupList(keyword, term);
//    }

    //TODO:适配Controller(大多服务放在UserService中)
    public List<GoodInfo> getGoodInfo(int studentId) {
        return null;
    }

    public List<RequestInfo> getRequestInfo(int studentId) {
        return null;
    }

}
